package com.draven.mybatis;

import com.draven.mybatis.config.DravenConfig;
import com.draven.mybatis.session.DravenConfiguration;
import com.draven.mybatis.session.DravenSqlSession;
import com.draven.mybatis.session.DravenSqlSessionFactory;
import com.draven.mybatis.session.DravenSqlSessionFactoryBuilder;
import org.apache.ibatis.test.mapper.UserMapper;
import org.apache.ibatis.test.pojo.User;

public class DravenTest {
  public static void main(String[] args) {
    // 读取 配置

    // 构建DravenConfiguration
    DravenConfiguration configuration = new DravenConfiguration();
    // 创建 sqlSessionFactory
    DravenSqlSessionFactory sqlSessionFactory = new DravenSqlSessionFactoryBuilder().build(configuration);
    // 创建 sqlSession
    DravenSqlSession dravenSqlSession = sqlSessionFactory.openSqlSession();
    // 得到代理对象
    UserMapper userMapper = dravenSqlSession.getMapper(UserMapper.class);

  }
}
